package com.bed.lovewithpatientbed.controller;

import com.bed.lovewithpatientbed.common.bean.LayUiPageBean;
import com.bed.lovewithpatientbed.pojo.Log;
import com.bed.lovewithpatientbed.service.LogService;
import com.bed.lovewithpatientbed.util.LayUiUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author Tyl
 * @version 1.0.0
 * @ClassName LogController.java
 * @Description TODO
 * @createTime 2020年10月21日 19:30:00
 */
@RequestMapping("log")
@Controller
public class LogController {
    @Resource
    LogService logService;
    /**
     * @description 按条件查询所有日志信息
     * @author tyl
     * @updateTime 2020/10/21 17:30
     * @param   pageBean:分页条件;operateor:操作者;result:操作结果;minTime:起始时间;maxTime:截止时间
     */
    @RequestMapping("listDo")
    @ResponseBody
    public Map<String,Object> list(LayUiPageBean pageBean, String operateor, String result, String minTime, String maxTime){
        List<Log> logList = logService.selectByExample(pageBean,operateor,result,minTime,maxTime);
        Integer count = logService.countNum( pageBean,  operateor,  result, minTime,  maxTime);
        return LayUiUtil.getLayTableResponseMap("success",0,count,logList);
    }
}
